package org.spring.boot.fusion.demo.service.impl;

import org.spring.boot.fusion.security.password.FusionPasswordEncoder;
import org.spring.boot.fusion.security.user.FusionUserDetails;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;

@Component
public class LoginUserServiceImpl implements UserDetailsService {

	@Override
	public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
		FusionPasswordEncoder fusionPasswordEncoder = new FusionPasswordEncoder();
		String encode = fusionPasswordEncoder.encode("123456");
		return new FusionUserDetails(username, encode);
	}

}
